#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
typedef struct ListNode {
	int data;
	struct ListNode* next;
}ListNode;
ListNode* findMax(ListNode* phead) {
	if (phead == NULL) {
		return NULL;
	}
	ListNode* current = phead->next;
	ListNode* maxNode = phead;
	while (current) {
		if (current->data > maxNode->data) {
			maxNode = current;
		}
		current = current->next;
	}
	return maxNode;
}
int main() {
	ListNode* plist = (ListNode*)malloc(sizeof(ListNode));
	plist->data = 90909000;
	plist->next= (ListNode*)malloc(sizeof(ListNode));
	plist->next->data = 99999;
	plist->next->next= (ListNode*)malloc(sizeof(ListNode));
	plist->next->next->data = 34;
	plist->next->next->next = NULL;
	ListNode* Max = findMax(plist);
	printf("%d ", Max->data);

	return 0;
}



#define m 10
typedef struct MyCircleQueue {
	int front;//ͷ
	int rear;//β
	int Q[m];
	int tag;
}CQueue;
//bool mcqEmpty(mcq* queue) {
//	return queue->front == queue->rear;
//}
//bool mcqFull(mcq* queue) {
//	return (queue->rear + 1) % (queue->k + 1) == queue->front;
//}
bool  EnQueue(CQueue* queue,int x) {
	if (queue->tag==1) {
		return false;
	}
	queue->Q[queue->rear] = x;
	queue->rear++;
	queue->rear %= m + 1;
	if (queue->rear == queue->front) {
		queue->tag = 0;
	}
	else if((queue->rear+1)%(m)==queue->front){
		queue->tag = 1;
	}
	return true;
}
bool DeQueue(CQueue* queue) {
	if (queue->tag == 0) {
		return false;
	}
	queue->front++;
	queue->front %= m + 1;
	if (queue->rear == queue->front) {
		queue->tag = 0;
	}
	else if ((queue->rear + 1) % (m) == queue->front) {
		queue->tag = 1;
	}
	return true;
}





int main() {
	CQueue* queue = (mcq*)malloc(sizeof(mcq));
	queue->front = 0;
	queue->rear = 0;
	queue->tag = 0;
	mcqPush(queue, 1);
	mcqPush(queue, 2);
	mcqPush(queue, 3);
	mcqPush(queue, 4);
	mcqPush(queue, 5);
	mcqPush(queue, 6);
	mcqPush(queue, 7);
	mcqPush(queue, 8);
	mcqPush(queue, 9);
	//mcqPush(queue, 10);
	for (int i = queue->front; i < queue->rear; i++) {
		printf("%d ", queue->a[i]);
	}
	printf("\n");
	mcqPop(queue);
	mcqPop(queue);
	mcqPop(queue);
	mcqPop(queue);
	mcqPop(queue);
	for (int i = queue->front; i < queue->rear; i++) {
		printf("%d ", queue->a[i]);
	}
	return 0;
}